//
// Created by wze-zero on 2024/9/16 016.
//
#include <iostream>
#include <vector>
#include <algorithm>

using namespace std;

int main() {
    int count, num;
    vector<int> vec;
    cin >> count;
    for (int i = 0; i < count; ++i) {
        cin >> num;
        vec.push_back(num);
    }
    sort(vec.begin(), vec.end(), greater<int>());
    for (vector<int>::iterator it = vec.begin(); it != vec.begin() + 5; ++it) {
        cout << *it << " ";
    }
    cout << endl;
    return 0;
}